//
//  MNDAutoTenderPlusCell.m
//  minidai
//
//  Created by Vitas on 2018/7/12.
//  Copyright © 2018年 迷你贷. All rights reserved.
//

#import "MNDAutoTenderPlusCell.h"

@implementation MNDAutoTenderPlusCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.limitAprLabel.layer.cornerRadius = 2.0f;
    self.limitAprLabel.layer.borderWidth = 1.0f;
    self.limitAprLabel.layer.borderColor = [UIColor colorWithRGB:0xFF664C].CGColor;
    // Initialization code
}

- (void)setModel:(MNDPlusTenderModel *)model {
    _model = model;
    self.titleLabel.text = model.plan_title;
    NSMutableAttributedString *yearAprStr = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@%%",model.plan_year_apr]];
    [yearAprStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14] range:NSMakeRange(yearAprStr.length - 1, 1)];
    self.yearAprLabel.attributedText = yearAprStr;
//    self.yearAprLabel.text = [NSString stringWithFormat:@"%@%%",model.plan_year_apr];
    self.deadlineLabel.text = [NSString stringWithFormat:@"%zd个月",model.plan_deadline];
    if (model.plan_coupon_apr.floatValue > 0) {
        self.limitAprLabel.hidden = NO;
        self.aprLabel.hidden = NO;
        self.aprLabel.text = [NSString stringWithFormat:@"+%@%%",model.plan_coupon_apr];;
    }else {
        self.limitAprLabel.hidden = YES;
        self.aprLabel.hidden = YES;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
